package com.fw.service.impl;

import java.util.List;

import com.fw.dao.EcommerceDao;
import com.fw.dao.impl.EcommerceDaoImpl;
import com.fw.model.Ecommerce;
import com.fw.service.EcommerceService;

public class EcommerceServiceImpl implements EcommerceService {
	EcommerceDao ecommerceDao = null;
	@Override
	public boolean add_ecommerceService(Ecommerce ecommerce) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.add_ecommerceDao(ecommerce);
	}

	@Override
	public boolean delete_ecommerceService(Ecommerce ecommerce) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.delete_ecommerceDao(ecommerce);
	}

	@Override
	public Ecommerce query_ecommerceByIdService(Ecommerce ecommerce) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.query_ecommerceByIdDao(ecommerce);
	}

	@Override
	public List<Ecommerce> query_allEcommerceService() {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.query_allEcommerceDao();
	}

	@Override
	public int query_totalEcommerceByPageService(String sql, List<Object> par) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.query_totalEcommerceByPageDao(sql, par);
	}

	@Override
	public List<Ecommerce> query_allEcommerceByPageService(String sql,
			int firstPage, int maxPage, List<Object> par) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.query_allEcommerceByPageDao(sql, firstPage, maxPage, par);
	}

	@Override
	public boolean update_ecommerceByIdService(Ecommerce ecommerce) {
		ecommerceDao = new EcommerceDaoImpl();
		return ecommerceDao.update_ecommerceByIdDao(ecommerce);
	}

}
